﻿/* -----------------------------------------------------------------------
 * <copyright file="SelAllContainer.xaml.cs" company="O-RID">
 *     Copyright (c)2010 O-RID Co.,Ltd.
 * </copyright>
 * <author>Zhang jun</author>
 * <summary> 
 *          SelAllContainer
 *          作成日：06/13/2010
 *                  07/05/2010 修改 在弹出查询子窗体的过程中，btnOPID按钮不可用。
 *                  07/08/2010 修改 日期选择默认为当天和后一天 （现场）。
 *                  08/10/2010 增加 数据导出功能（除了SV和QC都可以使用这个功能）。
 *                  08/19/2010 修改 OPID文本框内容的显示方式。
 *                  10/15/2010 增加 日志中记录用户查询条件。
 *                  01/10/2011 增加 F 和 G JOB。
 *                  04/20/2011 增加 案件名和线路选择条件。调整查询框整体结构。
 *                  04/22/2011 增加 线路查询按钮功能。
 *                  04/22/2011 增加 判定A，判定B JOB种类。
 *                  04/25/2011 增加 案件名子窗体查询功能。
 *                  04/26/2011 增加 线路、案件名 LOG记录。
 *                  05/25/2011 修改 JOB种类条件选择或移除"判定A,判定B,A,B"时出现的错误。
 *                  07/05/2011 增加 ScriptType(帐票种类) 查询信息子窗体查询功能。
 *                             删除 帐票种类 相关手动代码。
 *                  07/06/2011 增加 WordType（文字种类） 查询信息子窗体查询功能。
 *                             删除 文字种类 相关手动代码。
 *                             增加 JobClass（Job种类） 查询信息子窗体查询功能。
 *                             删除 Job种类 相关手动代码。
 * </summary>
 * -----------------------------------------------------------------------
 */

namespace Orid.Management.Statistics.OperatorUnitMangement.Common.SearchCtrl
{
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Media;
    using Orid.Management.Statistics.OperatorUnitMangement.Common.FunctionList;
    using childWindow = Orid.Management.Statistics.OperatorUnitMangement.Common.Window;
    using Command = Orid.Management.Statistics.OperatorUnitMangement.Command;
    using Wcf = Orid.Management.Statistics.OperatorUnitMangement.Common.Service;
    using Orid.Management.Statistics.OperatorUnitMangement.Common.Window;

    /// <summary>
    /// 查询区域控件 SelAllContainer
    /// </summary>
    public partial class SelAllContainer : UserControl
    {
        #region 全局变量

        /// <summary>
        /// 当前查询框的名字（日志用）
        /// </summary>
        private string ctrlName = " 共用查询框SelAllContainer ";

        /// <summary>
        /// 记录当前选择的 DockPanel控件名
        /// </summary>
        private string strDockPanelName = string.Empty; 
        
        /// <summary>
        /// 引用控件TAG值 
        /// </summary>
        private WCFServers.WCFCommonQueryRef.WCFCommonQueryClient wcfCommonQueryClient;
        
        /// <summary>
        /// 日志服务定义 wcfLogClient
        /// </summary>
        private WCFLog4Ref.WCFLog4Client wcfLogClient;
        
        /// <summary>
        /// 查询子窗体 opidSelect
        /// </summary>
        private childWindow.OPIDSelectChildWindow opidSelect;
        
        /// <summary>
        /// 消息子窗体 errorMessbox
        /// </summary>
        private childWindow.MessageBox errorMessbox;

        /// <summary>
        /// 查询命令 导出命令 queryCcommand
        /// </summary>
        private Command.ICommand queryCcommand = null, exportComand = null;

        /// <summary>
        /// 记录用户查询条件
        /// </summary>
        /// <value>10/15/2010 Add</value>
        public string WhereIntorLogs
        {
            get;
            set;
        }

        /// <summary>
        /// 查询子窗体 lineSelectWin
        /// 04/22/2011 ADD v2.14
        /// </summary>
        childWindow.LineSelChildWin lineSelectWin = null;

        /// <summary>
        /// 案件名查询子窗体 matterNameSelectWin
        /// 04/25/2011 add v2.14
        /// </summary>
        childWindow.MatterNameSelChildWin matterNameSelectWin = null;

        /// <summary>
        /// 帐票种类查询子窗体 striptTypeSelectWin
        /// 07/05/2011 add v2.15
        /// </summary>
        childWindow.ScriptTypeSelChildWin striptTypeSelectWin = null;


        /// <summary>
        /// WordType（文字种类）查询子窗体 wrodTypeSelectWin
        /// 07/06/2011 增加 v2.15
        /// </summary>
        childWindow.WordTypeSelChildWin wrodTypeSelectWin = null;

        /// <summary>
        /// JobClass种类 查询子窗体 jobClassSelectWin
        /// 07/06/2011 增加 v2.15
        /// </summary>
        childWindow.JobClassSelChildWin jobClassSelectWin = null;

        #endregion 全局变量

        /// <summary>
        /// 构造函数 SelAllContainer
        /// </summary>
        public SelAllContainer()
        {
            InitializeComponent();

            this.InitField();

            // 引用主题
            ((App)Application.Current).SetTheme(LayoutRoot);
            
            //Accordion 的Border 控件 引用主题
            //因为主题控件中只能包含一个子控件
            ((App)Application.Current).SetTheme(bAccordionItemBorder);
             
           
            #region 对...按钮的单击事件 委托
           
            
            // 线路条件... 按钮 v2.14
            this.btnSelContext.Click += new RoutedEventHandler(btnSelContext_Click);
            //线路子窗体关闭 v2.14
            this.lineSelectWin.Closed += new EventHandler(lineSelectWin_Closed);

            // 案件名  ...按钮 v2.14
            this.btnMatterName.Click += new RoutedEventHandler(btnMatterName_Click);
            // 案件名查询子窗体关闭事件 v2.14
            this.matterNameSelectWin.Closed += new EventHandler(matterNameSelectWin_Closed);

            // 帐票种类 ...按钮的单击事件 委托 2.15 
            this.btnACCOUNTVOTES.Click += new RoutedEventHandler(btnACCOUNTVOTES_Click);
            // 帐票种类查询子窗体关闭事件 v2.15
            this.striptTypeSelectWin.Closed += new EventHandler(striptTypeSelectWin_Closed);

            // WordType（文字种类）  ...按钮 v2.15
            this.btnWORD.Click += new RoutedEventHandler(btnWORD_Click);
            // WordType（文字种类）查询子窗体关闭事件 v2.15
            this.wrodTypeSelectWin.Closed += new EventHandler(wrodTypeSelectWin_Closed);

            // JobClass（job种类）  ...按钮 v2.15
            this.btnJOB.Click += new RoutedEventHandler(btnJOB_Click);
            // JobClass（job种类）查询子窗体关闭事件 v2.15
            this.jobClassSelectWin.Closed += new EventHandler(jobClassSelectWin_Closed);


            #endregion 对...按钮的单击事件 委托

            this.Loaded += new RoutedEventHandler(this.SelAllContainer_Loaded);

            // opid弹出子窗体
            this.btnOPID.Click += new RoutedEventHandler(this.BtnOPID_Click);

            // opid子窗体关闭事件
            this.opidSelect.Closed += new EventHandler(this.OpidSelect_Closed);

            // 查询符合条件的OP信息
            this.btnSelectAllInfor.Click += new RoutedEventHandler(this.BtnSelectAllInfor_Click);


            // 开始日期(DatePicker)
            this.dpDateFrom.SelectedDateChanged += new EventHandler<SelectionChangedEventArgs>(this.DpDateFrom_SelectedDateChanged);

            // 结束日期(DatePicker)
            this.dpDateTo.SelectedDateChanged += new EventHandler<SelectionChangedEventArgs>(this.DpDateTo_SelectedDateChanged);


            this.btnExport.Click += new RoutedEventHandler(this.BtnExport_Click);

            // 如果不是 SV或QC，显示导出按钮
            if (!(FunctionClass.GetUserIdentity() == FunctionClass.UserIdentity.SV.ToString() ||
                    FunctionClass.GetUserIdentity() == FunctionClass.UserIdentity.QC.ToString()))
            {
                this.btnExport.Visibility = Visibility.Visible;
            }
            else
            {
                this.btnExport.Visibility = Visibility.Collapsed;
            }

            #region 作废代码   记录

            /// 帐票种类，JOB种类，文字种类 由前台手动代码生成，
            /// 改为后台子窗体自动生成
            /// 以下代码作废 
            /// 07/05/2011 

            #region CheckBox  Checked 事件 委托

            //// CheckBox单击事件 委托
            //// <!--帐票种类-->
            //this.cbHandwriting.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);
            //this.cbPrinting.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);

            //// <!--文字种类-->
            //this.cbJapanese.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);
            //this.cbEnglishAndNumber.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);
            //this.cbOther.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);

            //// <!--Job种类-->
            //this.cbTrimer.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);
            //this.cbAlpha.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);
            //this.cbBeta.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);
            //this.cbA.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);
            //this.cbB.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);
            //this.cbD.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);
            //this.cbE.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);

            //// 增加 F 和 G JOB 2011/01/10 ADD 
            //this.cbF.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);
            //this.cbG.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);

            //// -30/05/2010--增加手动仕分项 this.cbDisassemble 
            //this.cbDisassemble.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);

            //// 增加 判定A，判定B 2011/04/22 ADD v2.14
            //this.cbJudgeA.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);
            //this.cbJudgeB.Checked += new RoutedEventHandler(this.CheckBoxALL_Checked);

            #endregion CheckBox单击事件 委托

            #region CheckBox  UnChecked 事件 委托

            //this.cbHandwriting.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //this.cbPrinting.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);

            //// <!--文字种类-->
            //this.cbJapanese.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //this.cbEnglishAndNumber.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //this.cbOther.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);

            //// <!--Job种类-->
            //this.cbTrimer.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //this.cbAlpha.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //this.cbBeta.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //this.cbA.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //this.cbB.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //this.cbD.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //this.cbE.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //// 增加 F 和 G JOB 2011/01/10 ADD 
            //this.cbF.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //this.cbG.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);

            //// -30/05/2010--增加手动仕分项 this.cbDisassemble 
            //this.cbDisassemble.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);

            //// 增加 判定A，判定B 2011/04/22 ADD v2.14
            //this.cbJudgeA.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);
            //this.cbJudgeB.Unchecked += new RoutedEventHandler(this.CheckBoxALL_Unchecked);

            #endregion

            //// 取服务端的CHECK的TAG值
            //this.wcfCommonQueryClient.TagInforCompleted += new EventHandler<WCFServers.WCFCommonQueryRef.TagInforCompletedEventArgs>(WcfCommonQueryClient_TagInforCompleted);
            
            //// 清除条件框的内容
            //this.btnClearTextBox.Click += new RoutedEventHandler(this.BtnClearTextBox_Click);


            #endregion 作废代码
        }


        /// <summary>
        /// Gets or sets vlaue of exportComand
        /// 导出命令 ExportComand
        /// </summary>
        public Command.ICommand ExportComand
        {
            get { return this.exportComand; }
            set { this.exportComand = value; }
        }

        /// <summary>
        /// Gets or sets value of queryCcommand
        /// 查询命令 QueryCcommand
        /// </summary>
        public Command.ICommand QueryCcommand
        {
            get { return this.queryCcommand; }
            set { this.queryCcommand = value; }
        }        

        /// <summary>
        /// 变量初始化方法  InitField
        /// </summary>
        private void InitField()
        {
            this.btnSelectAllInfor.IsEnabled = true;

            this.wcfCommonQueryClient = Wcf.Service.CommonQuery;
            this.wcfLogClient = Wcf.Service.Log4;
            this.opidSelect = new childWindow.OPIDSelectChildWindow();
            this.errorMessbox = new childWindow.MessageBox();
            
            // 04/22/2011 Add v2.14
            this.lineSelectWin = new LineSelChildWin();
            // 04/25/2011 add 2.14
            this.matterNameSelectWin = new MatterNameSelChildWin(MatterShape.MatterValue.ToString(), MatterShape.MatterValue.ToString());
            // 07/05/0211 add 2.15
            this.striptTypeSelectWin = new ScriptTypeSelChildWin();
            // 07/06/0211 add 2.15
            this.wrodTypeSelectWin = new WordTypeSelChildWin();
            this.jobClassSelectWin = new JobClassSelChildWin();


        }       

        /// <summary>
        /// 导出按钮 点击事件 BtnExport_Click
        /// </summary>
        /// <param name="sender">Sender of object</param>
        /// <param name="e">e type of RoutedEventArgs</param>
        private void BtnExport_Click(object sender, RoutedEventArgs e)
        {
            writeWhereLog();

            this.exportComand.Exec();
        }

        /// <summary>
        /// 查询按钮 点击事件 BtnSelectAllInfor_Click
        /// </summary>
        /// <param name="sender">Sender of object</param>
        /// <param name="e">e type of RoutedEventArgs</param>
        private void BtnSelectAllInfor_Click(object sender, RoutedEventArgs e)
        {

            writeWhereLog();

            this.btnSelectAllInfor.IsEnabled = false;
            this.queryCcommand.Exec();
        }

        #region  页面载入
        /// <summary>
        /// 页面载入 SelAllContainer_Loaded
        /// </summary>
        /// <param name="sender">Sender of object</param>
        /// <param name="e">e type of RoutedEventArgs</param>
        private void SelAllContainer_Loaded(object sender, RoutedEventArgs e)
        {

            this.btnOPID.IsEnabled = true;

            this.dpDateFrom.SelectedDate = DateTime.Now.AddDays(-1);

            this.dpDateTo.SelectedDate = DateTime.Now.Date;

        }
        #endregion 页面载入

        

        #region  查询子窗体相关
        /// <summary>
        /// 弹出查询子窗体(...按钮)
        /// BtnOPID_Click
        /// </summary>
        /// <param name="sender">Sender of object</param>
        /// <param name="e">e type of RoutedEventArgs</param>
        private void BtnOPID_Click(object sender, RoutedEventArgs e)
        {
            if (!String.IsNullOrEmpty(Common.FunctionList.ClientUserInfor.UserName))
            {

                if (!String.IsNullOrEmpty(this.tbOPID.Text))
                {
                    this.tbOPID.Text = string.Empty;
                }

                this.opidSelect.Title = "查询子窗体";
                this.opidSelect.Show();
                this.btnOPID.IsEnabled = false;
            }
            else 
            {
                Common.FunctionList.FunctionClass.ShowMessageBox(
                  this.errorMessbox,
                  1,
                  "提示",
                  "当前用户信息有误。",
                  Colors.Gray,
                  true,
                  Visibility.Visible,
                  Visibility.Collapsed);
                return;
            }
        }

        /// <summary>
        /// 子窗体关闭事件
        /// (对子窗体的选择条件进行显示和记录类型)
        /// </summary>
        /// <param name="sender">sender of object</param>
        /// <param name="e">e type of EventArgs</param>
        private void OpidSelect_Closed(object sender, EventArgs e)
        {        
            try
            {
                this.btnOPID.IsEnabled = true;
                tbOPID.Text = string.Empty;
                tbOPID.Tag = string.Empty;

                //this.opidSelect = (Common.Window.OPIDSelectChildWindow)sender;
                this.opidSelect = sender as Common.Window.OPIDSelectChildWindow;

                // 08/19/2010 -- 修改 OPID的显示方式
                if (this.opidSelect.DialogResult == true)
                {
                    /* 选择部分OP
                     * TextBox上显示的是所选的OP的ID号
                     * 添加逗号
                     * ClientDataList.SelOpIDList
                     */
                    if (ClientDataList.SelOpIDList.Count > 0)
                    {
                        StringBuilder sb = new StringBuilder();

                        foreach (string str in ClientDataList.SelOpIDList)
                        {
                            sb.Append(str + ",");
                        }

                        // 去除尾部多余逗号
                        this.tbOPID.Text = sb.ToString().Remove(sb.ToString().Length - 1, 1);
                        ClientDataList.SelOpIDList.Clear();
                        return;
                    }

                    /* 选择所有OP和选择组
                     * ClientDataList.CheckOpUnitList一旦有值，不能清空
                     * TextBox.Text上显示的是对应选择值
                     * TextBox.Tag 的值是后台判断的条件
                     */
                    if (ClientDataList.CheckOpUnitList.Count > 0)
                    {
                        tbOPID.Tag = "ALL";

                        //选择所有OP
                        if (this.opidSelect.SelectStatus.ToUpper().Contains("OPERATORS"))
                       {
                           tbOPID.Text = this.opidSelect.SelectStatus;
                       }
                        
                        //选择组
                        if (this.opidSelect.SelectStatus.ToUpper().Contains("UNIT")) 
                        {
                            StringBuilder sbUnit = new StringBuilder();
                            foreach (string unitName in ClientDataList.CheckOpUnitList) 
                            {
                                sbUnit.Append(unitName);
                                sbUnit.Append("Unit");
                                sbUnit.Append(" ");
                            }
                            tbOPID.Text = sbUnit.ToString();
                        } 
                        return;
                    }
                }

                if (this.opidSelect.DialogResult == false)
                {
                    return;
                }
            }
            catch (Exception ex)
            {
                this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr + ctrlName+" 转换OPID时出错" + ex.Message.ToString());

                Common.FunctionList.FunctionClass.ShowMessageBox(
                   this.errorMessbox,
                   1,
                   "提示",
                   ex.Message.ToString(),
                   Colors.Gray,
                   true,
                   Visibility.Visible,
                   Visibility.Collapsed);
                return;
            }            
        }
        #endregion  子窗体相关

        #region 日期(DatePicker)
        /// <summary>
        /// 结束日期(DatePicker)
        /// DpDateTo_SelectedDateChanged
        /// </summary>
        /// <param name="sender">sender of obejct</param>
        /// <param name="e">e type of SelectionChangedEventArgs</param>
        private void DpDateTo_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            if (dpDateTo == null || dpDateTo.SelectedDate == null)
            {
                return;
            }
            else 
            {
                this.dpDateTo.Text = this.dpDateTo.SelectedDate.Value.ToString("yyyy-MM-dd");
            }
        }

        /// <summary>
        /// 开始日期(DatePicker)
        /// 防止选错时，出现BUG
        /// </summary>
        /// <param name="sender">sender of object</param>
        /// <param name="e">e type of SelectionChangedEventArgs</param>
        private void DpDateFrom_SelectedDateChanged(object sender, SelectionChangedEventArgs e)
        {
            if (dpDateFrom == null || dpDateFrom.SelectedDate == null) 
            { 
                return; 
            }
            else
            {
                this.dpDateFrom.Text = this.dpDateFrom.SelectedDate.Value.ToString("yyyy-MM-dd");
            }
        }

        #endregion 日期(DatePicker)

        #region 记录用户选择的WHERE条件
        /// <summary>
        /// 记录用户选择的WHERE条件
        /// </summary>
        /// <returns></returns>
        /// <value>
        /// 10/15/2010 Add 
        /// 04/26/2011 增加 线路、案件名 LOG记录 add v2.14 
        /// </value>
        private void writeWhereLog()
        {
            StringBuilder sbWhereIntorLogs = new StringBuilder();
            try
            {
                //日志用
                sbWhereIntorLogs.Append(" 查询条件：");
                sbWhereIntorLogs.Append(" 开始日期：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.dpDateFrom.Text) == true ? " null" : this.dpDateFrom.Text);
                sbWhereIntorLogs.Append(" 结束日期：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.dpDateTo.Text) == true ? " null" :this.dpDateTo.Text);
                sbWhereIntorLogs.Append(" 帐票种类：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.tbACCOUNTVOTES.Text) == true ? " null" :this.tbACCOUNTVOTES.Text);
                sbWhereIntorLogs.Append(" JOB种类：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.tbJOB.Text) == true ? " null" :this.tbJOB.Text);
                sbWhereIntorLogs.Append(" 文字种类：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.tbWordType.Text) == true ? " null" : this.tbWordType.Text);
                sbWhereIntorLogs.Append(" OP信息：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.tbOPID.Text) == true ? " null" : this.tbOPID.Text);

                // 04/26/2011 增加 线路、案件名 LOG记录 add v2.14 
                sbWhereIntorLogs.Append(" 线路：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.tbSelContext.Text) == true ? " null" : this.tbSelContext.Text);
                sbWhereIntorLogs.Append(" 案件名：");
                sbWhereIntorLogs.Append(string.IsNullOrEmpty(this.tbMatterName.Text) == true ? " null" : this.tbMatterName.Text);
 
            }
            catch 
            {
                WhereIntorLogs = string.Empty;
            }

            WhereIntorLogs = sbWhereIntorLogs.ToString();
        }

        #endregion 记录用户选择的WHERE条件

        #region LINE线路子窗体相关 v2.14
        /// <summary>
        /// LINE线路子窗体关闭
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void lineSelectWin_Closed(object sender, EventArgs e)
        {
            try
            {
                this.lineSelectWin = sender as childWindow.LineSelChildWin;

                if (this.lineSelectWin.DialogResult == true)
                {
                    //将LINE记录值添加逗号(多值时-用于界面上的TEXT中显示值)
                    if (ClientDataList.SelLineList.Count > 0)
                    {
                        #region 多值时,添加逗号
                        StringBuilder sb = new StringBuilder();
                        foreach (string str in ClientDataList.SelLineList)
                        {
                            sb.Append(str + ",");
                        }

                        this.tbSelContext.Text = string.Empty;

                        // 去除尾部多余逗号
                        this.tbSelContext.Text = sb.ToString().Remove(sb.ToString().Length - 1, 1);
                        #endregion 多值时,添加逗号

                        this.tbSelContext.Text = string.Empty;
                        this.tbSelContext.Text = this.lineSelectWin.retRadioButtonContent.ToString();
                        return;
                    }
                    //取消所有选择时或是没有选择时，清空文本
                    else
                    {
                        this.tbSelContext.Text = string.Empty;
                    }
                }

               
                if (this.lineSelectWin.DialogResult == false)
                {
                    //当按取消按钮时，清空文本 v2.14
                    this.tbSelContext.Text = string.Empty;

                    return;
                }
            }
            catch (Exception ex)
            {
                this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr +
                                                ctrlName +
                                                " lineSelectWin_Closed 转换Line信息时出错" +
                                                ex.Message.ToString());

                this.btnSelectAllInfor.IsEnabled = true;

                Common.FunctionList.FunctionClass.ShowMessageBox(
                   this.errorMessbox,
                   1,
                   "提示",
                   ex.Message.ToString(),
                   Colors.Gray,
                   true,
                   Visibility.Visible,
                   Visibility.Collapsed);
                return;
            }
        }

        /// <summary>
        /// ... 按钮，显示LINE窗体
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void btnSelContext_Click(object sender, RoutedEventArgs e)
        {
            this.lineSelectWin.Title = "线路查询子窗体";
            this.lineSelectWin.Show();
        }
        #endregion LINE线路子窗体相关

        #region 案件名查询子窗相关

        /// <summary>
        ///... 按钮，显示案件名子窗体
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void btnMatterName_Click(object sender, RoutedEventArgs e)
        {
            this.matterNameSelectWin.Title = "案件名查询子窗体";
            this.matterNameSelectWin.Show();
            
        }

        /// <summary>
        /// 案件名查询子窗体关闭事件
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        /// <value>04/25/2011 add v2.14</value>
        void matterNameSelectWin_Closed(object sender, EventArgs e)
        {
            try
            {
                this.matterNameSelectWin = sender as childWindow.MatterNameSelChildWin;

                if (this.matterNameSelectWin.DialogResult == true)
                {
                    //将LINE记录值添加逗号(多值时-用于界面上的TEXT中显示值)
                    if (ClientDataList.SelMatterNamesList.Count > 0)
                    {
                        #region 多值时,添加逗号
                        StringBuilder sb = new StringBuilder();
                        foreach (string str in ClientDataList.SelMatterNamesList)
                        {
                            sb.Append(str + ",");
                        }

                        this.tbMatterName.Text = string.Empty;

                        // 去除尾部多余逗号
                        this.tbMatterName.Text = sb.ToString().Remove(sb.ToString().Length - 1, 1);
                        #endregion 多值时,添加逗号

                        this.tbMatterName.Text = string.Empty;
                        this.tbMatterName.Text = this.matterNameSelectWin.retRadioButtonContent.ToString();
                        return;
                    }
                    //取消所有选择时或是没有选择时，清空文本
                    else
                    {
                        this.tbMatterName.Text = string.Empty;
                    }
                }

                if (this.matterNameSelectWin.DialogResult == false)
                {
                    //当按取消按钮时，清空文本 v2.14
                    this.tbMatterName.Text = string.Empty;

                    return;
                }
            }
            catch (Exception ex)
            {
                this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr +
                                                ctrlName +
                                                " matterNameSelectWin_Closed 转换案件名信息时出错" +
                                                ex.Message.ToString());

                this.btnSelectAllInfor.IsEnabled = true;

                Common.FunctionList.FunctionClass.ShowMessageBox(
                   this.errorMessbox,
                   1,
                   "提示",
                   ex.Message.ToString(),
                   Colors.Gray,
                   true,
                   Visibility.Visible,
                   Visibility.Collapsed);
                return;
            }
        }

        #endregion 案件名查询子窗相关

        #region 帐票查询子窗体相关
        /// <summary>
        ///  ...按钮 显示帐票种类子窗体
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void btnACCOUNTVOTES_Click(object sender, RoutedEventArgs e)
        {
            this.striptTypeSelectWin.Title = "帐票种类查询子窗体";
            this.striptTypeSelectWin.Show();
        }

        /// <summary>
        /// 帐票种类查询子窗体关闭事件
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void striptTypeSelectWin_Closed(object sender, EventArgs e)
        {
            try
            {
                this.striptTypeSelectWin = sender as childWindow.ScriptTypeSelChildWin;

                if (this.striptTypeSelectWin.DialogResult == true)
                {
                    //将帐票种类记录值添加逗号(多值时-用于界面上的TEXT中显示值)
                    if (ClientDataList.SelScriptTypeList.Count > 0)
                    {
                        #region 多值时,添加逗号
                        StringBuilder sb = new StringBuilder();
                        foreach (string str in ClientDataList.SelScriptTypeList)
                        {
                            sb.Append(str + ",");
                        }

                        this.tbACCOUNTVOTES.Text = string.Empty;

                        // 去除尾部多余逗号
                        this.tbACCOUNTVOTES.Text = sb.ToString().Remove(sb.ToString().Length - 1, 1);
                        #endregion 多值时,添加逗号

                        this.tbACCOUNTVOTES.Text = string.Empty;
                        this.tbACCOUNTVOTES.Text = this.striptTypeSelectWin.retRadioButtonContent.ToString();
                        return;
                    }
                    //取消所有选择时或是没有选择时，清空文本
                    else
                    {
                        this.tbACCOUNTVOTES.Text = string.Empty;
                    }
                }

                if (this.striptTypeSelectWin.DialogResult == false)
                {
                    //当按取消按钮时，清空文本 v2.14
                    this.tbACCOUNTVOTES.Text = string.Empty;

                    return;
                }
            }
            catch (Exception ex)
            {
                this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr +
                                                ctrlName +
                                                " striptTypeSelectWin_Closed 转换帐票种类信息时出错" +
                                                ex.Message.ToString());

                this.btnSelectAllInfor.IsEnabled = true;

                Common.FunctionList.FunctionClass.ShowMessageBox(
                   this.errorMessbox,
                   1,
                   "提示",
                   ex.Message.ToString(),
                   Colors.Gray,
                   true,
                   Visibility.Visible,
                   Visibility.Collapsed);
                return;
            }
        }

        #endregion 帐票查询子窗体相关

        #region WordType（文字种类）查询子窗体相关
        /// <summary>
        /// WordType（文字种类）查询子窗体关闭事件 v2.15
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void wrodTypeSelectWin_Closed(object sender, EventArgs e)
        {
            try
            {
                this.wrodTypeSelectWin = sender as childWindow.WordTypeSelChildWin;

                if (this.wrodTypeSelectWin.DialogResult == true)
                {
                    //将WordType记录值添加逗号(多值时-用于界面上的TEXT中显示值)
                    if (ClientDataList.SelWordTypeList.Count > 0)
                    {
                        #region 多值时,添加逗号
                        StringBuilder sb = new StringBuilder();
                        foreach (string str in ClientDataList.SelWordTypeList)
                        {
                            sb.Append(str + ",");
                        }

                        this.tbWordType.Text = string.Empty;

                        // 去除尾部多余逗号
                        this.tbWordType.Text = sb.ToString().Remove(sb.ToString().Length - 1, 1);
                        #endregion 多值时,添加逗号

                        this.tbWordType.Text = string.Empty;
                        this.tbWordType.Text = this.wrodTypeSelectWin.retRadioButtonContent.ToString();
                        return;
                    }
                    //取消所有选择时或是没有选择时，清空文本
                    else
                    {
                        this.tbWordType.Text = string.Empty;
                    }
                }

                if (this.wrodTypeSelectWin.DialogResult == false)
                {
                    //当按取消按钮时，清空文本 v2.14
                    this.tbWordType.Text = string.Empty;

                    return;
                }
            }
            catch (Exception ex)
            {
                this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr +
                                                ctrlName +
                                                " wrodTypeSelectWin_Closed 转文字种类信息时出错" +
                                                ex.Message.ToString());

                this.btnSelectAllInfor.IsEnabled = true;

                Common.FunctionList.FunctionClass.ShowMessageBox(
                   this.errorMessbox,
                   1,
                   "提示",
                   ex.Message.ToString(),
                   Colors.Gray,
                   true,
                   Visibility.Visible,
                   Visibility.Collapsed);
                return;
            }
        }

        /// <summary>
        /// WordType（文字种类）  ...按钮 v2.15
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void btnWORD_Click(object sender, RoutedEventArgs e)
        {
            this.wrodTypeSelectWin.Title = "文字种类查询子窗体";
            this.wrodTypeSelectWin.Show();
        }

        #endregion WordType（文字种类）查询子窗体相关

        #region JobClass（job种类）查询子窗体相关
        /// <summary>
        /// JobClass（job种类）  ...按钮 
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The  instance containing the event data.</param>
        void btnJOB_Click(object sender, RoutedEventArgs e)
        {
            this.jobClassSelectWin.Title = "Job种类查询子窗体";
            this.jobClassSelectWin.Show();
        }

        /// <summary>
        /// JobClass（job种类）查询子窗体关闭v2.15
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The instance containing the event data.</param>
        void jobClassSelectWin_Closed(object sender, EventArgs e)
        {
            try
            {
                this.jobClassSelectWin = sender as childWindow.JobClassSelChildWin;

                if (this.jobClassSelectWin.DialogResult == true)
                {
                    //将JobClass记录值添加逗号(多值时-用于界面上的TEXT中显示值)
                    if (ClientDataList.SelJobClassList.Count > 0)
                    {
                        #region 多值时,添加逗号
                        StringBuilder sb = new StringBuilder();
                        foreach (string str in ClientDataList.SelJobClassList)
                        {
                            sb.Append(str + ",");
                        }

                        this.tbJOB.Text = string.Empty;

                        // 去除尾部多余逗号
                        this.tbJOB.Text = sb.ToString().Remove(sb.ToString().Length - 1, 1);
                        #endregion 多值时,添加逗号

                        this.tbJOB.Text = string.Empty;
                        this.tbJOB.Text = this.jobClassSelectWin.retRadioButtonContent.ToString();
                        return;
                    }
                    //取消所有选择时或是没有选择时，清空文本
                    else
                    {
                        this.tbJOB.Text = string.Empty;
                    }
                }

                if (this.jobClassSelectWin.DialogResult == false)
                {
                    
                    this.tbJOB.Text = string.Empty;

                    return;
                }
            }
            catch (Exception ex)
            {
                this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr +
                                                ctrlName +
                                                " jobClassSelectWin_Closed 转文字种类信息时出错" +
                                                ex.Message.ToString());

                this.btnSelectAllInfor.IsEnabled = true;

                Common.FunctionList.FunctionClass.ShowMessageBox(
                   this.errorMessbox,
                   1,
                   "提示",
                   ex.Message.ToString(),
                   Colors.Gray,
                   true,
                   Visibility.Visible,
                   Visibility.Collapsed);
                return;
            }
        }


        #endregion JobClass（job种类）查询子窗体相关


        #region 作废代码  记录

        /// 帐票种类，JOB种类，文字种类 由前台手动代码生成，
        /// 改为后台子窗体自动生成
        /// 以下代码作废 
        /// 07/05/2011 
        /// 
        #region 隐藏选择控件

        ///// <summary>
        /////  隐藏选择控件
        /////  HideSelectPanel
        ///// </summary>
        //private void HideSelectPanel()
        //{
        //    this.tbTitle.Text = string.Empty;
        //    this.tbTitle.Visibility = Visibility.Collapsed;

        //    this.ACCOUNTVOTES.Visibility = Visibility.Collapsed;
        //    this.WORD.Visibility = Visibility.Collapsed;
        //    this.JOB.Visibility = Visibility.Collapsed;
        //}
        #endregion 隐藏选择控件

        #region  ...按钮的单击事件
        ///// <summary>
        ///// ...按钮（除OP查询的...按钮）
        ///// ...按钮的单击事件（公用）
        ///// 根据...按钮的Tag值来判断显示哪个StackPanel
        ///// </summary>
        ///// <param name="sender">Sender of object</param>
        ///// <param name="e">e type of RoutedEventArgs</param>
        //private void BtnTitleSelect_Click(object sender, RoutedEventArgs e)
        //{
        //    try
        //    {
        //        // 选择区的TITLE
        //        this.tbTitle.Text = string.Empty;
        //        this.tbTitle.Visibility = Visibility.Visible;

        //        // 将按钮的TAG值给TITLE
        //        this.tbTitle.Text = ((Button)sender).Tag.ToString();

        //        this.strDockPanelName = string.Empty;

        //        // 记录是哪个按钮点击
        //        this.strDockPanelName = ((Button)sender).Name.Trim();

        //        // 跟据按钮名称，判断显示哪个StackPanel
        //        // Button与StackPanel的名称相同
        //        // 界面上的Button的名称为“tbn”+“名称”，StackPanel的名称为“名称”
        //        if (!String.IsNullOrEmpty(this.strDockPanelName))
        //        {
        //            // 去掉名称里的tbn
        //            this.strDockPanelName = this.strDockPanelName.Substring(3, this.strDockPanelName.Length - 3);
        //        }
        //        else
        //        {
        //            throw (new Exception("当点击...按钮时，出现的对应选项出错！"));
        //        }

        //        // 帐票种类
        //        if (this.strDockPanelName.Equals("ACCOUNTVOTES"))
        //        {
        //            this.ACCOUNTVOTES.Visibility = Visibility.Visible;
        //            this.spClear.Visibility = Visibility.Visible;
        //            this.WORD.Visibility = Visibility.Collapsed;
        //            this.JOB.Visibility = Visibility.Collapsed;
        //        }

        //        // 文字种类
        //        if (this.strDockPanelName.Equals("WORD"))
        //        {
        //            this.ACCOUNTVOTES.Visibility = Visibility.Collapsed;
        //            this.spClear.Visibility = Visibility.Visible;
        //            this.WORD.Visibility = Visibility.Visible;
        //            this.JOB.Visibility = Visibility.Collapsed;
        //        }

        //        // Job种类
        //        if (this.strDockPanelName.Equals("JOB"))
        //        {
        //            this.ACCOUNTVOTES.Visibility = Visibility.Collapsed;
        //            this.WORD.Visibility = Visibility.Collapsed;
        //            this.JOB.Visibility = Visibility.Visible;
        //            this.spClear.Visibility = Visibility.Visible;
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr + " SelAllContainer " + ex.Message.ToString());

        //        Common.FunctionList.FunctionClass.ShowMessageBox(
        //           this.errorMessbox,
        //           1,
        //           "提示",
        //           ex.Message.ToString(),
        //           Colors.Gray,
        //           true,
        //           Visibility.Visible,
        //           Visibility.Collapsed);
        //        return;
        //    }
        //}
        #endregion ...按钮的单击事件

        #region CheckBox 事件

        ///// <summary>
        ///// CheckBox  Checked 事件
        ///// </summary>
        ///// <param name="sender">sender of object</param>
        ///// <param name="e">e type of RoutedEventArgs</param>           
        //private void CheckBoxALL_Checked(object sender, RoutedEventArgs e)
        //{
        //    try
        //    {
        //        string objNam = string.Empty;

        //        // 用StackPanel的控件名来确定向哪个TEXTBOX传值
        //        // StackPanel的控件名和TEXTBOX控件名相同
        //        // 界面上的TEXTBOX的名称为“tb”+“名称”，StackPanel的名称为“名称”
        //        string objName = "tb" + this.strDockPanelName.Trim();

        //        this.AddString(((CheckBox)sender).Tag.ToString(), FindName(objName));
        //    }
        //    catch (Exception ex)
        //    {
        //        this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr + " SelAllContainer 前台...按钮 " + ex.Message.ToString());
        //        FunctionClass.ShowMessageBox(
        //           this.errorMessbox,
        //           1,
        //           "提示",
        //           ex.Message.ToString(),
        //           Colors.Gray,
        //           true,
        //           Visibility.Visible,
        //           Visibility.Collapsed);
        //        return;
        //    }
        //}

        ///// <summary>
        ///// CheckBox Unchecked 事件
        ///// </summary>
        ///// <param name="sender">sender of object</param>
        ///// <param name="e">e type of  RoutedEventArgs</param>
        //private void CheckBoxALL_Unchecked(object sender, RoutedEventArgs e)
        //{
        //    try
        //    {
        //        string objNam = string.Empty;

        //        // 用StackPanel的控件名来确定向哪个TEXTBOX传值
        //        string objName = "tb" + this.strDockPanelName.Trim();

        //        this.CutString(((CheckBox)sender).Tag.ToString(), FindName(objName));
        //    }
        //    catch (Exception ex)
        //    {
        //        this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr + " SelAllContainer 前台...按钮 " + ex.Message.ToString());
        //        FunctionClass.ShowMessageBox(
        //           this.errorMessbox,
        //           1,
        //           "提示",
        //           ex.Message.ToString(),
        //           Colors.Gray,
        //           true,
        //           Visibility.Visible,
        //           Visibility.Collapsed);
        //        return;

        //    }
        //}

        ///// <summary>
        ///// 当CHECKBOX选中时
        ///// 把选中项添加到STR中
        ///// </summary>
        ///// <param name="str">传来的 想要添加的值</param>
        ///// <param name="senderText">目标控件 senderText</param>        
        //private void AddString(string str, object senderText)
        //{
        //    string mystr = string.Empty;
        //    TextBox tb = senderText as TextBox;

        //    if (tb == null) return;

        //    // 先判断目标控件是否有内容
        //    if (String.IsNullOrEmpty(tb.Text))
        //    {
        //        // 如果是空，是首次输入
        //        mystr = str;
        //    }
        //    else
        //    {
        //        // 不是首次输入 原有的内容+","+现有内容
        //        mystr += tb.Text.ToString() + "," + str;
        //    }

        //    tb.Text = string.Empty;
        //    tb.Text = mystr;

        //    List<string> aa = new List<string>();

        //    #region 将（object）sender改为 sender as object
        //    //// 先判断目标控件是否有内容
        //    //if (String.IsNullOrEmpty(((TextBox)senderText).Text))
        //    //{
        //    //    // 如果是空，是首次输入
        //    //    mystr = str;
        //    //}
        //    //else
        //    //{
        //    //    // 不是首次输入 原有的内容+","+现有内容
        //    //    mystr += ((TextBox)senderText).Text.ToString() + "," + str;
        //    //}

        //    //((TextBox)senderText).Text = string.Empty;
        //    //((TextBox)senderText).Text = mystr;
        //    #endregion
        //}

        ///// <summary>
        ///// 当CHECKBOX不选时
        ///// 移除相所选项
        ///// </summary>
        ///// <param name="str">传来的,想要减去的值 str</param>
        ///// <param name="senderText">目标控件 senderText</param>
        ///// <value>
        ///// 在" ,判定A，B,A, " 的情况下， 如果先判断"A," 会变成 ",判定B,A,"这种状态
        ///// 所以，判断顺序 先为 ",+str"  然后为 "str+, "
        ///// 05/25/2011 v2.14 问题改修
        ///// </value>
        //private void CutString(string str, object senderText)
        //{
        //    try
        //    {
        //        string newStr = string.Empty;
        //        if (String.IsNullOrEmpty(((TextBox)senderText).Text))
        //        {
        //            return;
        //        }

        //        // 只有一个值(移除时不用考虑，号)
        //        if (((TextBox)senderText).Text.Length - str.Trim().Length == 0)
        //        {
        //            newStr = ((TextBox)senderText).Text.Trim().Substring(str.Length, ((TextBox)senderText).Text.Trim().Length - str.Length);
        //            ((TextBox)senderText).Text = newStr;
        //            return;
        //        }
        //        else
        //        {
        //            // 不是一个值时，移除时考虑,号

        //            /// 在" ,判定A，B,A, " 的情况下， 如果先判断"A," 会变成 ",判定B,A,"这种状态
        //            /// 所以，判断顺序 先为 ",+str"  然后为 "str+, "
        //            /// 05/25/2011 v2.14 问题改修

        //            string teststr = string.Empty;
        //            teststr = "," + str;
        //            if (((TextBox)senderText).Text.Trim().Contains(teststr.Trim()))
        //            {
        //                newStr = ((TextBox)senderText).Text.Trim().Remove(
        //                    ((TextBox)senderText).Text.Trim().IndexOf(teststr.Trim()), teststr.Trim().Length);

        //                ((TextBox)senderText).Text = newStr;
        //                return;
        //            }

        //            teststr = string.Empty;
        //            teststr = str + ",";
        //            if (((TextBox)senderText).Text.Trim().Contains(teststr.Trim()))
        //            {
        //                // 不是只有一个值，减去str+，
        //                newStr = ((TextBox)senderText).Text.Trim().Remove(
        //                    ((TextBox)senderText).Text.Trim().IndexOf(teststr.Trim()), teststr.Trim().Length);

        //                ((TextBox)senderText).Text = newStr;
        //                return;
        //            }


        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr + ctrlName + ex.Message.ToString());
        //        Common.FunctionList.FunctionClass.ShowMessageBox(
        //           this.errorMessbox,
        //           1,
        //           "提示",
        //           ex.Message.ToString(),
        //           Colors.Gray,
        //           true,
        //           Visibility.Visible,
        //           Visibility.Collapsed);
        //        return;
        //    }
        //}

        #endregion CheckBox单击事件

        #region 取服务端的CHECK的TAG值，赋给控件
        ///// <summary>
        ///// 取服务端的CHECK的TAG值
        ///// 赋给控件
        ///// </summary>
        ///// <param name="sender">sender of object</param>
        ///// <param name="e">e type of TagInforCompletedEventArgs</param>
        //private void WcfCommonQueryClient_TagInforCompleted(object sender, WCFServers.WCFCommonQueryRef.TagInforCompletedEventArgs e)
        //{
        //    try
        //    {
        //        if (e.Error == null)
        //        {
        //            // 赋值顺序不能变。
        //            if (e.Result.Count > 0)
        //            {

        //                // 手书
        //                this.cbHandwriting.Tag = e.Result[0].ToString();

        //                // 活字
        //                this.cbPrinting.Tag = e.Result[1].ToString();

        //                // 日语
        //                this.cbJapanese.Tag = e.Result[2].ToString();

        //                // 英数
        //                this.cbEnglishAndNumber.Tag = e.Result[3].ToString();

        //                // 其它
        //                this.cbOther.Tag = e.Result[4].ToString();

        //                // Trimer
        //                this.cbTrimer.Tag = e.Result[5].ToString();

        //                // Alpha
        //                this.cbAlpha.Tag = e.Result[6].ToString();

        //                // Beta
        //                this.cbBeta.Tag = e.Result[7].ToString();
        //                this.cbA.Tag = e.Result[8].ToString();
        //                this.cbB.Tag = e.Result[9].ToString();
        //                this.cbD.Tag = e.Result[10].ToString();
        //                this.cbE.Tag = e.Result[11].ToString();

        //                // -30/05/2010--增加手动仕分项 this.cbDisassemble 
        //                this.cbDisassemble.Tag = e.Result[12].ToString();

        //                // 01/10/2011 增加 F和GJOB的枚举值
        //                this.cbF.Tag = e.Result[13].ToString();
        //                this.cbG.Tag = e.Result[14].ToString();

        //                // 04/22/2011 增加 判定A，判定B JOB种类。v2.14
        //                this.cbJudgeA.Tag = e.Result[15].ToString();
        //                this.cbJudgeB.Tag = e.Result[16].ToString();
        //            }
        //            else
        //            {
        //                throw new Exception("服务端TAG值列表为空！");
        //            }
        //        }
        //        else
        //        {
        //            throw new Exception("取服务端TAG值出错！" + e.Error.Message.ToString());
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        this.wcfLogClient.ErrorAsync(((App)Application.Current).LogStr + ctrlName + ex.Message.ToString());

        //        Common.FunctionList.FunctionClass.ShowMessageBox(
        //           this.errorMessbox,
        //           1,
        //           "提示",
        //           ex.Message.ToString(),
        //           Colors.Gray,
        //           true,
        //           Visibility.Visible,
        //           Visibility.Collapsed);
        //        return;
        //    }
        //}
        #endregion 取服务端的CHECK的TAG值，赋给控件

        #region 清除条件框的内容(清空按钮)

        ///// <summary>
        ///// 清除条件框的内容
        ///// BtnClearTextBox_Click
        ///// </summary>
        ///// <param name="sender">sender of object</param>
        ///// <param name="e">e type of RoutedEventArgs</param>
        //private void BtnClearTextBox_Click(object sender, RoutedEventArgs e)
        //{
        //    if (!String.IsNullOrEmpty(this.strDockPanelName))
        //    {
        //        // 清空对应文本
        //        ((TextBox)FindName(("tb" + this.strDockPanelName))).Text = string.Empty;

        //        // 将StackPanel里的CheckBox状态变为不选
        //        if (this.strDockPanelName.ToUpper().Equals("JOB"))
        //        {
        //            // 06/09/2010 Job种类 由StackPanel改为WrapPanel 
        //            foreach (CheckBox cb in ((WrapPanel)(FindName(strDockPanelName))).Children)
        //            {
        //                cb.IsChecked = false;
        //            }
        //        }
        //        else
        //        {
        //            foreach (CheckBox cb in ((StackPanel)(FindName(strDockPanelName))).Children)
        //            {
        //                cb.IsChecked = false;
        //            }
        //        }
        //    }
        //}
        #endregion 清除条件框的内容

        #endregion 作废代码

    }
}
